#-------------------------------------------------------------------------------
# Name:        rename_files
# Purpose:     rename files with in a dir which specify by param
#
# Author:      Lotte
#
# Created:     10/08/2012
# Copyright:   (c) Lotte 2012
# Licence:     <your licence>
#-------------------------------------------------------------------------------

import os,sys

def rename_files(path):
    for filename in os.listdir(path) :
        fullname = path + filename
        newname = fullname + '.jpg'
        print filename + "==>" + newname
        os.rename(fullname, newname)

def main():
    path = "./"
    print sys.argv[0]
    if len(sys.argv) > 1 :
        path = sys.argv[1]
    print path

    rename_files(path)

if __name__ == '__main__':
    main()
